<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- ie 9+ 其他浏览器都不执行，ie8-执行 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="container">
        <button class="btn btn-info" data-toggle="modal" data-target="#testModal">弹框</button>
        <button class="btn btn-primary" id="secbtn">第二种弹框</button>
    </div>
    
    <div class="modal fade" id="testModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    用户登录
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                </div>
                <div class="modal-body">
                        <form action="">
                            <div class="form-group">
                                <label>电子邮件</label>
                                <input type="text" class="form-control">
                            </div>
                            <div class="form-group">
                                <label>密码</label>
                                <input type="password" class="form-control">
                            </div>
                        </form>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary">登录</button>
                    <button class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>

    </div>
    
    <script src="js/jquery-3.2.1.js"></script>
    <script src="js/bootstrap.min.js"></script>
    
    <script>
        $("#secbtn").click(function(){
            $("#testModal").modal({
                show:true,
                backdrop:'static',
                keyboard: true
            });


        });
    </script>
   
</body>
</html>